package com.sky.loveshop.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author xcy
 * @version V1.0
 * @description
 * @date 2024/9/1 12:52
 */
public class OrderUtils {

    /**
     *
     * @return
     */
    public static String generateOrderNumber() {
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        return now.format(formatter);
    }

    /**
     * 生成私域订单编号
     */
    public static String generatePrivateOrderNumber() {
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        return "xyzg" + now.format(formatter);
    }

    public static void main(String[] args) {
        String orderNumber = generateOrderNumber();
        System.out.println("Order Number: " + orderNumber);
    }
}
